﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
namespace GSLMS.Entity
{
	/// <summary>
	/// 2.3.63    催收详细信息表
	/// </summary>
	[DataContract(IsReference = true)]
	public partial class TB_COL_MAINDETAIL: IObjectWithChangeTracker, INotifyPropertyChanged
	{
		public TB_COL_MAINDETAIL()
		{}
		#region Model
		private long _id;
		private long _loanid;
		private long _proid;
		private long _conid;
		private long _colid;
		private string _colby;
		private string _coljoinby;
		private Nullable<DateTime> _createdate;
		private string _colmod;
		private Nullable<DateTime> _startdate;
		private int _startdatehour;
		private int _startdatesecond;
		private Nullable<DateTime> _enddate;
		private int _enddatehour;
		private int _enddatesecond;
		private string _importance;
		private Nullable<DateTime> _nextdate;
		private string _colcon;
		private Nullable<DateTime> _promisedate;
		private decimal _promiseamt;
		private int _isunworkcol;
		private string _remark;
		/// <summary>
		/// 记录ID唯一
		/// </summary>
		[DataMember]
		public long ID
		{
			get{return _id;}
			set{
				if ( _id!= value)
				{
					if (ChangeTracker.ChangeTrackingEnabled && ChangeTracker.State != ObjectState.Added)
					{
						throw new InvalidOperationException("属性“ID”是对象键的一部分，不可更改。仅当未跟踪对象或对象处于“已添加”状态时，才能对键属性进行更改。");
					}
					 _id = value;
					OnPropertyChanged("ID");
				}
			}
		}
		/// <summary>
		/// 放款记录IDTb_Loan_Main.ID
		/// </summary>
		[DataMember]
		public long LOANID
		{
			get{return _loanid;}
			set{
				if ( _loanid!= value)
				{
					 _loanid = value;
					OnPropertyChanged("LOANID");
				}
			}
		}
		/// <summary>
		/// 立项申请记录ID
		/// </summary>
		[DataMember]
		public long PROID
		{
			get{return _proid;}
			set{
				if ( _proid!= value)
				{
					 _proid = value;
					OnPropertyChanged("PROID");
				}
			}
		}
		/// <summary>
		/// 合同记录ID
		/// </summary>
		[DataMember]
		public long CONID
		{
			get{return _conid;}
			set{
				if ( _conid!= value)
				{
					 _conid = value;
					OnPropertyChanged("CONID");
				}
			}
		}
		/// <summary>
		/// 催收信息记录ID
		/// </summary>
		[DataMember]
		public long COLID
		{
			get{return _colid;}
			set{
				if ( _colid!= value)
				{
					 _colid = value;
					OnPropertyChanged("COLID");
				}
			}
		}
		/// <summary>
		/// 催收人
		/// </summary>
		[DataMember]
		public string COLBY
		{
			get{return _colby;}
			set{
				if ( _colby!= value)
				{
					 _colby = value;
					OnPropertyChanged("COLBY");
				}
			}
		}
		/// <summary>
		/// 共同催收人
		/// </summary>
		[DataMember]
		public string COLJOINBY
		{
			get{return _coljoinby;}
			set{
				if ( _coljoinby!= value)
				{
					 _coljoinby = value;
					OnPropertyChanged("COLJOINBY");
				}
			}
		}
		/// <summary>
		/// 记录时间
		/// </summary>
		[DataMember]
		public Nullable<DateTime> CREATEDATE
		{
			get{return _createdate;}
			set{
				if ( _createdate!= value)
				{
					 _createdate = value;
					OnPropertyChanged("CREATEDATE");
				}
			}
		}
		/// <summary>
		/// 催收方式
		/// </summary>
		[DataMember]
		public string COLMOD
		{
			get{return _colmod;}
			set{
				if ( _colmod!= value)
				{
					 _colmod = value;
					OnPropertyChanged("COLMOD");
				}
			}
		}
		/// <summary>
		/// 催收开始日期
		/// </summary>
		[DataMember]
		public Nullable<DateTime> STARTDATE
		{
			get{return _startdate;}
			set{
				if ( _startdate!= value)
				{
					 _startdate = value;
					OnPropertyChanged("STARTDATE");
				}
			}
		}
		/// <summary>
		/// 催收开始日期小时
		/// </summary>
		[DataMember]
		public int STARTDATEHOUR
		{
			get{return _startdatehour;}
			set{
				if ( _startdatehour!= value)
				{
					 _startdatehour = value;
					OnPropertyChanged("STARTDATEHOUR");
				}
			}
		}
		/// <summary>
		/// 催收开始日期分钟
		/// </summary>
		[DataMember]
		public int STARTDATESECOND
		{
			get{return _startdatesecond;}
			set{
				if ( _startdatesecond!= value)
				{
					 _startdatesecond = value;
					OnPropertyChanged("STARTDATESECOND");
				}
			}
		}
		/// <summary>
		/// 催收结束日期
		/// </summary>
		[DataMember]
		public Nullable<DateTime> ENDDATE
		{
			get{return _enddate;}
			set{
				if ( _enddate!= value)
				{
					 _enddate = value;
					OnPropertyChanged("ENDDATE");
				}
			}
		}
		/// <summary>
		/// 催收结束小时
		/// </summary>
		[DataMember]
		public int ENDDATEHOUR
		{
			get{return _enddatehour;}
			set{
				if ( _enddatehour!= value)
				{
					 _enddatehour = value;
					OnPropertyChanged("ENDDATEHOUR");
				}
			}
		}
		/// <summary>
		/// 催收结束分钟
		/// </summary>
		[DataMember]
		public int ENDDATESECOND
		{
			get{return _enddatesecond;}
			set{
				if ( _enddatesecond!= value)
				{
					 _enddatesecond = value;
					OnPropertyChanged("ENDDATESECOND");
				}
			}
		}
		/// <summary>
		/// 重要性
		/// </summary>
		[DataMember]
		public string IMPORTANCE
		{
			get{return _importance;}
			set{
				if ( _importance!= value)
				{
					 _importance = value;
					OnPropertyChanged("IMPORTANCE");
				}
			}
		}
		/// <summary>
		/// 下次催收日期
		/// </summary>
		[DataMember]
		public Nullable<DateTime> NEXTDATE
		{
			get{return _nextdate;}
			set{
				if ( _nextdate!= value)
				{
					 _nextdate = value;
					OnPropertyChanged("NEXTDATE");
				}
			}
		}
		/// <summary>
		/// 催收情况
		/// </summary>
		[DataMember]
		public string COLCON
		{
			get{return _colcon;}
			set{
				if ( _colcon!= value)
				{
					 _colcon = value;
					OnPropertyChanged("COLCON");
				}
			}
		}
		/// <summary>
		/// 承诺还款日期
		/// </summary>
		[DataMember]
		public Nullable<DateTime> PROMISEDATE
		{
			get{return _promisedate;}
			set{
				if ( _promisedate!= value)
				{
					 _promisedate = value;
					OnPropertyChanged("PROMISEDATE");
				}
			}
		}
		/// <summary>
		/// 承诺还款金额
		/// </summary>
		[DataMember]
		public decimal PROMISEAMT
		{
			get{return _promiseamt;}
			set{
				if ( _promiseamt!= value)
				{
					 _promiseamt = value;
					OnPropertyChanged("PROMISEAMT");
				}
			}
		}
		/// <summary>
		/// 适合非工作时间催收0否，1是
		/// </summary>
		[DataMember]
		public int ISUNWORKCOL
		{
			get{return _isunworkcol;}
			set{
				if ( _isunworkcol!= value)
				{
					 _isunworkcol = value;
					OnPropertyChanged("ISUNWORKCOL");
				}
			}
		}
		/// <summary>
		/// 备注
		/// </summary>
		[DataMember]
		public string REMARK
		{
			get{return _remark;}
			set{
				if ( _remark!= value)
				{
					 _remark = value;
					OnPropertyChanged("REMARK");
				}
			}
		}
		#endregion Model

	#region ChangeTracking
	   
	protected virtual void OnPropertyChanged(String propertyName)
	{
	    if (ChangeTracker.State != ObjectState.Added && ChangeTracker.State != ObjectState.Deleted)
	    {
	        ChangeTracker.State = ObjectState.Modified;
	    }
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	protected virtual void OnNavigationPropertyChanged(String propertyName)
	{
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged{ add { _propertyChanged += value; } remove { _propertyChanged -= value; } }
	private event PropertyChangedEventHandler _propertyChanged;
	private ObjectChangeTracker _changeTracker;
	   
	[DataMember]
	public ObjectChangeTracker ChangeTracker
	{
	    get
	    {
	        if (_changeTracker == null)
	        {
	            _changeTracker = new ObjectChangeTracker();
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	        return _changeTracker;
	    }
	    set
	    {
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging -= HandleObjectStateChanging;
	        }
	        _changeTracker = value;
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	    }
	}
	   
	private void HandleObjectStateChanging(object sender, ObjectStateChangingEventArgs e)
	{
	    if (e.NewState == ObjectState.Deleted)
	    {
	        ClearNavigationProperties();
	    }
	}
	   
	protected bool IsDeserializing { get; private set; }
	   
	[OnDeserializing]
	public void OnDeserializingMethod(StreamingContext context)
	{
	    IsDeserializing = true;
	}
	   
	[OnDeserialized]
	public void OnDeserializedMethod(StreamingContext context)
	{
	    IsDeserializing = false;
	    ChangeTracker.ChangeTrackingEnabled = true;
	}
	   
	protected virtual void ClearNavigationProperties()
	{
	}
	
	#endregion

	}
}

